GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

counter.js ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
c 3
b 0
f 0
nc 1
dl 0
loc 3
rs 10
nop 0
1
const ssn = require('short-string-number');
2
3
const config = require('./../configs/main');
4
5
/**
6
 * Counter - is class which calculates count of received messages
7
 * and shows current count value in counter block.
8
 */
9
class Counter {
10
  /**
11
   * Counter's constructor.
12
   */
13
  constructor() {
14
    this.count = 0;
15
  }
16
17
  /**
18
   * Increments counter value.
19
   */
20
  inc() {
21
    this.count += 1;
22
23
    this.showCount();
24
  }
25
26
  /**
27
   * Renders current counter value counter block.
28
   */
29
  showCount() {
30
    const c = ssn(this.count);
31
    document.getElementById('counter').innerHTML = typeof c === 'number' ? c.toString() : c;
32
    document.getElementById('counterPrecise').innerHTML = this.count.toString();
33
34
    if (this.count >= config.thresholdToDisplayCounter) {
35
      document.getElementById('counterBlock').style.display = 'block';
36
    }
37
  }
38
}
39
40
module.exports = new Counter();
41